package com.mockStatic;

import org.junit.Test;
import org.mockito.MockedStatic;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mockStatic;

public class StaticUtilsTest {

    @Test
    public void testStaticMethod(){
        try(
                MockedStatic<StaticUtils> mockedStatic = mockStatic(StaticUtils.class)
        ){
            //设置模拟行为
            mockedStatic.when(()->StaticUtils.staticMethod("test")).thenReturn("Mocked: test");

            // 调用静态方法并断言
            assertEquals("Mocked: test", StaticUtils.staticMethod("test"));


        }
    }
}
